package org.lanplay.server;

import java.util.Properties;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.persist.jpa.JpaPersistModule;
import com.google.inject.servlet.GuiceServletContextListener;

public class LanPlayGuiceServletContextListener extends GuiceServletContextListener {

	@Override
	protected Injector getInjector() {
		Properties dbProps = new Properties();
		dbProps.put("hibernate.connection.url", System.getProperty("hibernate.connection.url", "jdbc:h2:target/test"));
		return Guice.createInjector(new org.lanplay.server.WebModule(), new ServerModule(), new JpaPersistModule(
				"db-manager").properties(dbProps));
	}

}
